\documentclass[12pt]{article}
\usepackage{amsfonts}
\usepackage{bm}

% symbol used for sqrt(-1)
\newcommand{\Ci}{{\rm i}}

\newcommand{\C}{\mathbb{C}}
\newcommand{\R}{\mathbb{R}}

\newcommand{\code}[1]{{\tt{#1}}}

\newcommand{\boost}[1][]{{\ensuremath{ {\bf H}{#1}_{\bm{\hat m}}(\beta) }}}
\newcommand{\rotat}[1][]{{\ensuremath{ {\bf U}{#1}_{\bm{\hat n}}(\phi) }}}

\newcommand{\pauli}[1]{\ensuremath{ {\bm\sigma}_{\rm #1} }}

\newcommand{\pdi}[2]{\ensuremath{ {{\delta {#2}}\over{\delta {#1}}} }}

\begin{document}

\section{Quaternion Differentiation}

A quaternion, $\bm{H}$, may be represented by the linear combination,
\begin{equation}
\bm{H}=\sum_{i=0}^3 h_i\pauli{i}
\end{equation}
where:
\begin{equation}\label{eqn:properties}
\pauli{i}^2 = \pauli{i}\pauli{j}\pauli{k} = -\pauli{0},
\end{equation}
and $\{i,j,k\}$ is chosen from cyclic permutations of $\{1,2,3\}$.
A quaternion function, $\bm{F}(\bm{H})$, may then be written as
\begin{equation}
\bm{F}(\bm{H})=\sum_{i=0}^3 f_i(h_0,h_1,h_2,h_3)\pauli{i}
\end{equation}
If $\bm{F}(\bm{H})$ is single-valued function of $\bm{H}$, the derivative
of $\bm{F}(\bm{H})$ is defined as
\begin{equation}
\bm{F}^\prime(\bm{H}) = \lim_{\bm{\Delta H}\to0}
	{ {\bm{F}(\bm{H}+\bm{\Delta H}) - \bm{F}(\bm{H})}\over{\bm{\Delta H}} }
\end{equation}
provided that the limit exists independent of the manner in which
$\bm{\Delta H}\to0$.  Consider four possible ways that $\bm{\Delta H}$ may
approach zero, in which all but one of $\Delta h_i$ equals zero.  The
four cases may be written as:
\begin{equation}
\bm{F}^\prime(\bm{H})_j = \sum_{i=0}^3 
{ {\delta{f_i}\pauli{i}}\over{\delta{h_j}\pauli{j}} } 
\end{equation}
which can be expanded to produce
\begin{eqnarray}
\bm{F}^\prime(\bm{H})_0 =
  { {\delta{f_0}}\over{\delta{h_0}} }\pauli{0}
+ { {\delta{f_1}}\over{\delta{h_0}} }\pauli{1}
+ { {\delta{f_2}}\over{\delta{h_0}} }\pauli{2}
+ { {\delta{f_3}}\over{\delta{h_0}} }\pauli{3} \\
\bm{F}^\prime(\bm{H})_1 =
  { {\delta{f_1}}\over{\delta{h_1}} }\pauli{0}
- { {\delta{f_0}}\over{\delta{h_1}} }\pauli{1}
- { {\delta{f_3}}\over{\delta{h_1}} }\pauli{2}
+ { {\delta{f_2}}\over{\delta{h_1}} }\pauli{3} \\
\bm{F}^\prime(\bm{H})_2 =
  { {\delta{f_2}}\over{\delta{h_2}} }\pauli{0}
+ { {\delta{f_3}}\over{\delta{h_2}} }\pauli{1}
- { {\delta{f_0}}\over{\delta{h_2}} }\pauli{2}
- { {\delta{f_1}}\over{\delta{h_2}} }\pauli{3} \\
\bm{F}^\prime(\bm{H})_3 =
  { {\delta{f_3}}\over{\delta{h_3}} }\pauli{0}
- { {\delta{f_2}}\over{\delta{h_3}} }\pauli{1}
+ { {\delta{f_1}}\over{\delta{h_3}} }\pauli{2}
- { {\delta{f_0}}\over{\delta{h_3}} }\pauli{3}
\end{eqnarray}
Equating (6)-(9) yields:
\begin{eqnarray}
+ { {\delta{f_0}}\over{\delta{h_0}} } = + { {\delta{f_1}}\over{\delta{h_1}} } =
+ { {\delta{f_2}}\over{\delta{h_2}} } = + { {\delta{f_3}}\over{\delta{h_3}} }\\
+ { {\delta{f_1}}\over{\delta{h_0}} } = - { {\delta{f_0}}\over{\delta{h_1}} } =
+ { {\delta{f_3}}\over{\delta{h_2}} } = - { {\delta{f_2}}\over{\delta{h_3}} }\\
+ { {\delta{f_2}}\over{\delta{h_0}} } = - { {\delta{f_3}}\over{\delta{h_1}} } =
- { {\delta{f_0}}\over{\delta{h_2}} } = + { {\delta{f_1}}\over{\delta{h_3}} }\\
+ { {\delta{f_3}}\over{\delta{h_0}} } = + { {\delta{f_2}}\over{\delta{h_1}} } =
- { {\delta{f_1}}\over{\delta{h_2}} } = - { {\delta{f_0}}\over{\delta{h_3}} }
\end{eqnarray}
Define the quaternion ``del'' operator:
\begin{equation}
\bm{\Delta}= {\delta\over\delta h_0}\pauli{0} 
	- \sum_{i=1}^3{\delta\over\delta h_i}\pauli{i}
\end{equation}
then
\begin{eqnarray}
(\bm{\Delta F})_0
  = \pdi{h_0}{f_0} + \pdi{h_1}{f_1} + \pdi{h_2}{f_2} + \pdi{h_3}{f_3}
  = 4\pdi{h_0}{f_0}
\end{eqnarray}
and
\begin{eqnarray}
(\bm{\Delta F})_1
  = \pdi{h_0}{f_1} - \pdi{h_1}{f_0} - \pdi{h_2}{f_3} + \pdi{h_3}{f_2} = 0 \\
(\bm{\Delta F})_2
  = \pdi{h_0}{f_2} + \pdi{h_1}{f_3} - \pdi{h_2}{f_0} - \pdi{h_3}{f_1} = 0 \\
(\bm{\Delta F})_3
  = \pdi{h_0}{f_3} - \pdi{h_1}{f_2} + \pdi{h_2}{f_1} - \pdi{h_3}{f_0} = 0
\end{eqnarray}
That is, if a quaternion function is differentiable, then its gradient
is scalar and equal to four times the partial derivative of the scalar
component of $\bm{F}$ ($f_0$) with respect to the scalar component of 
$\bm{H}$ ($h_0$).
\end{document}


